package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobile   string `gorm:"type:char(11)" json:"mobile"`
	Password string `gorm:"type:varchar(32)" json:"password"`
	NickName string `gorm:"type:varchar(30)" json:"nickName"`
	HeadImg  string `gorm:"type:varchar(200)" json:"headImg"`
}

type House struct {
	gorm.Model
	Title   string  `gorm:"type:varchar(30)" json:"title"`
	Intro   string  `gorm:"type:varchar(100)" json:"intro"`
	Price   float64 `gorm:"type:decimal(10,2)" json:"price"`
	Address string  `gorm:"type:varchar(50)" json:"address"`
	Types   string  `gorm:"type:varchar(50)" json:"types"`
	Area    float64 `gorm:"type:decimal(10,2)" json:"area"`
	UserId  int64   `gorm:"type:int" json:"userId"`
}
type UserHouse struct {
	gorm.Model
	House
	NickName string `gorm:"type:varchar(30)" json:"nickName"`
}

type Reservation struct {
	gorm.Model
	UserId  int64  `gorm:"type:int" json:"userId"`
	HouseId int64  `gorm:"type:int" json:"houseId"`
	ResTime string `gorm:"type:varchar(50)" json:"resTime"`
	Status  string `gorm:"type:varchar(30)" json:"status"`
}

type UserHouseUserHouse struct {
	Reservation
	NickName string  `gorm:"type:varchar(30)" json:"nickName"`
	Mobile   string  `gorm:"type:char(11)" json:"mobile"`
	Address  string  `gorm:"type:varchar(50)" json:"address"`
	Types    string  `gorm:"type:varchar(50)" json:"types"`
	Area     float64 `gorm:"type:decimal(10,2)" json:"area"`
}
type Ask struct {
	gorm.Model
	UserId  int64  `gorm:"type:int" json:"userId"`
	HouseId int64  `gorm:"type:int" json:"houseId"`
	Content string `gorm:"type:varchar(100)" json:"content"`
}
